
#ifndef __DSA_KEYPAIR_GENERATOR_H
#define __DSA_KEYPAIR_GENERATOR_H

#include "DSAPublicKey.h"
#include "DSAPrivateKey.h"

/** An DSA key pair generator. */
class DSAKeyPairGenerator
{
   public:
      DSAKeyPairGenerator(int nbits, const char *name);
      DSAKeyPairGenerator(const DSAKeyPairGenerator &o);
      DSAKeyPairGenerator &operator=(const DSAKeyPairGenerator &o);
      ~DSAKeyPairGenerator();
      int checkAreKeyPair();
      static int checkAreKeyPair(DSAPublicKey *ipub, DSAPrivateKey *iprv);
      DSAPublicKey *getPublicKey();
      DSAPrivateKey *getPrivateKey();
      DSAPublicKey *popPublicKey();
      DSAPrivateKey *popPrivateKey();
   private:
      /** Generate key pair into the DSAPublicKey and DSAPrivateKey
       * classes. */
      int generateKeyPair(int nbits, const char *name);
      /** Pointer to the DSA public key. */
      DSAPublicKey *pub;
      /** Pointer to the DSA private key. */
      DSAPrivateKey *prv;
};

#endif
